<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>业务流程图 - 电商平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* 全局样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            color: #333;
            line-height: 1.6;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            min-height: 100vh;
        }

        .container {
            max-width: 1200px;
            width: 100%;
            background-color: #fff;
            border-radius: 16px;
            padding: 40px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
            position: relative;
            overflow: hidden;
        }

        /* 装饰元素 */
        .container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 6px;
            background: linear-gradient(90deg, #4285f4, #34a853, #ea4335, #9c27b0);
        }

        .header {
            text-align: center;
            margin-bottom: 50px;
            position: relative;
        }

        .header h1 {
            font-size: 32px;
            color: #333;
            margin-bottom: 15px;
            font-weight: 700;
            letter-spacing: -0.5px;
            display: inline-block;
            position: relative;
        }

        .header h1::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 25%;
            width: 50%;
            height: 4px;
            background: linear-gradient(90deg, #4285f4, #34a853);
            border-radius: 2px;
        }

        .header p {
            color: #666;
            font-size: 18px;
            margin-top: 20px;
        }

        /* 流程图容器 */
        .flowchart-container {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 600px;
            background: linear-gradient(135deg, #f9f9f9 0%, #f1f1f1 100%);
            border-radius: 16px;
            padding: 60px 40px;
            overflow: hidden;
            box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        /* 装饰性背景元素 */
        .flowchart-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 100%;
            background-image: 
                radial-gradient(rgba(66, 133, 244, 0.1) 2px, transparent 2px),
                radial-gradient(rgba(66, 133, 244, 0.1) 2px, transparent 2px);
            background-size: 40px 40px;
            background-position: 0 0, 20px 20px;
            opacity: 0.3;
            pointer-events: none;
        }

        /* 流程图节点 */
        .node {
            width: 220px;
            background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
            color: white;
            padding: 25px 20px;
            border-radius: 16px;
            text-align: center;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            position: relative;
            font-weight: 600;
            font-size: 18px;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 10;
            cursor: pointer;
            border: 2px solid rgba(255, 255, 255, 0.1);
        }

        .node:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
            border-color: rgba(255, 255, 255, 0.3);
        }

        .node:active {
            transform: translateY(-4px) scale(0.98);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
        }

        /* 节点图标 */
        .node-icon {
            font-size: 32px;
            margin-bottom: 10px;
            display: block;
            opacity: 0.9;
        }

        /* 节点之间的连接线 */
        .connector {
            position: absolute;
            background: linear-gradient(90deg, #666, #999);
            z-index: 5;
            transition: all 0.3s ease;
            border-radius: 2px;
        }

        .connector-horizontal {
            height: 4px;
            width: 120px;
            top: 50%;
            left: 100%;
            transform: translateY(-50%);
        }

        .connector-vertical {
            width: 4px;
            height: 100px;
            left: 50%;
            top: 100%;
            transform: translateX(-50%);
        }

        .connector-diagonal {
            position: absolute;
            height: 4px;
            background: linear-gradient(90deg, #666, #999);
            z-index: 5;
            border-radius: 2px;
        }

        /* 方向箭头 */
        .arrow {
            position: absolute;
            width: 14px;
            height: 14px;
            border-top: 4px solid #666;
            border-right: 4px solid #666;
            transform: rotate(45deg);
            z-index: 6;
            background-color: #f9f9f9;
        }

        .arrow-right {
            top: 50%;
            right: -5px;
            transform: translateY(-50%) rotate(45deg);
        }

        .arrow-down {
            left: 50%;
            bottom: -5px;
            transform: translateX(-50%) rotate(135deg);
        }

        /* 节点组样式 */
        .node-group {
            display: flex;
            justify-content: center;
            gap: 200px;
            margin: 100px 0;
            position: relative;
        }

        .node-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
        }

        /* 颜色变体 */
        .node-blue {
            background: linear-gradient(135deg, #4285f4 0%, #5b9bf3 100%);
        }

        .node-green {
            background: linear-gradient(135deg, #34a853 0%, #42d36b 100%);
        }

        .node-red {
            background: linear-gradient(135deg, #ea4335 0%, #f36d60 100%);
        }

        .node-purple {
            background: linear-gradient(135deg, #9c27b0 0%, #ba68c8 100%);
        }

        /* 节点状态指示器 */
        .node-status {
            position: absolute;
            top: -10px;
            right: -10px;
            width: 28px;
            height: 28px;
            background-color: #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
            font-size: 16px;
            font-weight: bold;
        }

        /* 节点描述 */
        .node-description {
            margin-top: 15px;
            font-size: 14px;
            color: #666;
            text-align: center;
            max-width: 200px;
        }

        /* 交互提示 */
        .interaction-tip {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            z-index: 100;
        }

        .flowchart-container:hover .interaction-tip {
            opacity: 1;
        }

        /* 高亮效果 */
        .highlight-path {
            animation: pathHighlight 2s ease-in-out;
        }

        @keyframes pathHighlight {
            0%, 100% {
                background: linear-gradient(90deg, #666, #999);
                opacity: 0.6;
            }
            50% {
                background: linear-gradient(90deg, #4285f4, #34a853);
                opacity: 1;
                box-shadow: 0 0 10px rgba(66, 133, 244, 0.5);
            }
        }

        /* 响应式设计 */
        @media (max-width: 1024px) {
            .container {
                padding: 30px;
            }

            .node-group {
                gap: 150px;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 25px;
            }

            .header h1 {
                font-size: 28px;
            }

            .header p {
                font-size: 16px;
            }

            .flowchart-container {
                padding: 40px 20px;
            }

            .node {
                width: 180px;
                padding: 20px 15px;
                font-size: 16px;
            }

            .node-icon {
                font-size: 28px;
            }

            .node-group {
                gap: 100px;
                margin: 80px 0;
            }

            .connector-horizontal {
                width: 80px;
            }

            .connector-vertical {
                height: 80px;
            }

            #connector-registered-to-home, #connector-register-to-home {
                width: 30%;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 10px;
            }

            .container {
                padding: 20px;
                border-radius: 12px;
            }

            .header h1 {
                font-size: 24px;
            }

            .header p {
                font-size: 14px;
            }

            .flowchart-container {
                padding: 30px 10px;
                min-height: 500px;
            }

            .node {
                width: 140px;
                padding: 15px 10px;
                font-size: 14px;
            }

            .node-icon {
                font-size: 24px;
            }

            .node-group {
                gap: 60px;
                margin: 60px 0;
            }

            .connector-horizontal {
                width: 50px;
            }

            .connector-vertical {
                height: 60px;
            }

            .node-description {
                font-size: 12px;
                max-width: 120px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1><i class="fas fa-sitemap"></i> 业务流程图</h1>
            <p>用户登录与注册流程示意图</p>
        </div>

        <div class="flowchart-container">
            <!-- 首页节点 -->
            <div class="node-container" id="home-node">
                <div class="node node-blue">
                    <i class="fas fa-home node-icon"></i>
                    首页
                </div>
                <div class="node-description">用户访问系统的入口页面</div>
            </div>

            <!-- 连接线：首页 -> 未登录 -->
            <div id="connector-home-to-unlogged" class="connector connector-vertical"></div>
            <div class="arrow arrow-down"></div>

            <!-- 未登录节点 -->
            <div class="node-container" id="unlogged-node">
                <div class="node node-red">
                    <i class="fas fa-user-slash node-icon"></i>
                    未登录
                </div>
                <div class="node-description">用户未登录状态，需要进行身份验证</div>
            </div>

            <!-- 连接线：未登录 -> 已注册/未注册 -->
            <div id="connector-unlogged-to-options" class="connector connector-vertical"></div>
            <div class="arrow arrow-down"></div>

            <!-- 已注册和未注册节点组 -->
            <div class="node-group">
                <!-- 已注册节点 -->
                <div class="node-container" id="registered-node">
                    <div class="node node-green">
                        <i class="fas fa-user-check node-icon"></i>
                        已注册
                    </div>
                    <div class="node-description">用户已有账号，直接登录</div>
                </div>

                <!-- 未注册节点 -->
                <div class="node-container" id="unregistered-node">
                    <div class="node node-purple">
                        <i class="fas fa-user-plus node-icon"></i>
                        未注册
                    </div>
                    <div class="node-description">新用户需要先注册账号</div>
                </div>
            </div>

            <!-- 连接线：已注册 -> 首页 -->
            <div id="connector-registered-to-home" class="connector-diagonal" style="position: absolute; height: 4px; top: 60%; left: 30%; width: 40%; transform: rotate(-45deg); transform-origin: top left;"></div>
            <div id="arrow-registered-to-home" class="arrow" style="position: absolute; top: 70%; left: 60%; transform: rotate(-45deg); background-color: #f9f9f9;"></div>

            <!-- 连接线：未注册 -> 注册 -->
            <div id="connector-unregistered-to-register" class="connector connector-vertical" style="position: absolute; left: 75%;"></div>
            <div class="arrow arrow-down" style="left: 75%;"></div>

            <!-- 注册节点 -->
            <div class="node-container" id="register-node">
                <div class="node node-purple">
                    <i class="fas fa-file-signature node-icon"></i>
                    注册
                </div>
                <div class="node-description">用户完成注册流程，创建新账号</div>
            </div>

            <!-- 连接线：注册 -> 首页 -->
            <div id="connector-register-to-home" class="connector-diagonal" style="position: absolute; height: 4px; bottom: 30%; left: 30%; width: 40%; transform: rotate(45deg); transform-origin: bottom left;"></div>
            <div id="arrow-register-to-home" class="arrow" style="position: absolute; bottom: 40%; left: 60%; transform: rotate(135deg); background-color: #f9f9f9;"></div>

            <!-- 交互提示 -->
            <div class="interaction-tip">点击节点查看流程详情</div>
        </div>
    </div>

    <script>
        // 页面加载完成后执行
        document.addEventListener('DOMContentLoaded', function() {
            // 获取所有节点和连接线元素
            const nodes = document.querySelectorAll('.node');
            const connectors = document.querySelectorAll('.connector, .connector-diagonal');
            
            // 节点描述信息
            const nodeDetails = {
                'home-node': '系统的主页面，展示核心功能和内容。用户访问系统首先看到的页面。',
                'unlogged-node': '用户未登录状态，需要进行身份验证才能访问系统的完整功能。',
                'registered-node': '已有账号的用户可以直接登录系统，进入首页。',
                'unregistered-node': '新用户需要先注册账号，填写必要的个人信息。',
                'register-node': '用户完成注册流程，系统创建新账号，注册成功后自动登录并返回首页。'
            };
            
            // 为每个节点添加点击事件
            nodes.forEach(node => {
                node.addEventListener('click', function() {
                    // 获取当前节点的容器ID
                    const nodeId = this.closest('.node-container').id;
                    
                    // 移除所有节点的选中状态
                    nodes.forEach(n => {
                        n.style.transform = 'none';
                        n.style.boxShadow = '0 8px 24px rgba(0, 0, 0, 0.15)';
                    });
                    
                    // 添加当前节点的选中状态
                    this.style.transform = 'translateY(-8px) scale(1.05)';
                    this.style.boxShadow = '0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.3)';
                    
                    // 高亮相关路径
                    highlightPath(nodeId);
                    
                    // 添加短暂的脉冲动画
                    this.classList.add('pulse');
                    setTimeout(() => {
                        this.classList.remove('pulse');
                    }, 1000);
                    
                    // 显示节点详情提示（可以根据需要扩展为弹窗）
                    showNodeDetails(nodeDetails[nodeId]);
                });
            });
            
            // 高亮节点路径
            function highlightPath(nodeId) {
                // 重置所有连接线
                connectors.forEach(connector => {
                    connector.classList.remove('highlight-path');
                });
                
                // 根据节点ID高亮相关路径
                switch(nodeId) {
                    case 'home-node':
                        document.getElementById('connector-home-to-unlogged').classList.add('highlight-path');
                        break;
                    case 'unlogged-node':
                        document.getElementById('connector-home-to-unlogged').classList.add('highlight-path');
                        document.getElementById('connector-unlogged-to-options').classList.add('highlight-path');
                        break;
                    case 'registered-node':
                        document.getElementById('connector-home-to-unlogged').classList.add('highlight-path');
                        document.getElementById('connector-unlogged-to-options').classList.add('highlight-path');
                        document.getElementById('connector-registered-to-home').classList.add('highlight-path');
                        break;
                    case 'unregistered-node':
                        document.getElementById('connector-home-to-unlogged').classList.add('highlight-path');
                        document.getElementById('connector-unlogged-to-options').classList.add('highlight-path');
                        document.getElementById('connector-unregistered-to-register').classList.add('highlight-path');
                        break;
                    case 'register-node':
                        document.getElementById('connector-home-to-unlogged').classList.add('highlight-path');
                        document.getElementById('connector-unlogged-to-options').classList.add('highlight-path');
                        document.getElementById('connector-unregistered-to-register').classList.add('highlight-path');
                        document.getElementById('connector-register-to-home').classList.add('highlight-path');
                        break;
                }
            }
            
            // 显示节点详情
            function showNodeDetails(details) {
                // 检查是否已存在详情提示框
                let detailsBox = document.getElementById('node-details-box');
                if (!detailsBox) {
                    detailsBox = document.createElement('div');
                    detailsBox.id = 'node-details-box';
                    detailsBox.style.position = 'fixed';
                    detailsBox.style.bottom = '20px';
                    detailsBox.style.left = '50%';
                    detailsBox.style.transform = 'translateX(-50%)';
                    detailsBox.style.background = 'rgba(0, 0, 0, 0.85)';
                    detailsBox.style.color = 'white';
                    detailsBox.style.padding = '15px 20px';
                    detailsBox.style.borderRadius = '12px';
                    detailsBox.style.fontSize = '14px';
                    detailsBox.style.boxShadow = '0 4px 16px rgba(0, 0, 0, 0.3)';
                    detailsBox.style.zIndex = '1000';
                    detailsBox.style.maxWidth = '80%';
                    detailsBox.style.opacity = '0';
                    detailsBox.style.transition = 'opacity 0.3s ease';
                    document.body.appendChild(detailsBox);
                }
                
                // 更新详情内容并显示
                detailsBox.textContent = details;
                detailsBox.style.opacity = '1';
                
                // 3秒后自动隐藏
                clearTimeout(window.detailsTimeout);
                window.detailsTimeout = setTimeout(() => {
                    detailsBox.style.opacity = '0';
                }, 3000);
            }
            
            // 添加页面进入动画
            const flowElements = document.querySelectorAll('.node, .connector, .arrow');
            flowElements.forEach((el, index) => {
                el.style.opacity = '0';
                el.style.transform = 'translateY(20px)';
                el.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
                
                setTimeout(() => {
                    el.style.opacity = '1';
                    el.style.transform = 'translateY(0)';
                }, 150 * index);
            });
            
            // 页面滚动时添加视差效果
            window.addEventListener('scroll', function() {
                const scrollPosition = window.scrollY;
                const container = document.querySelector('.flowchart-container');
                
                // 视差效果
                flowElements.forEach(el => {
                    if (el.classList.contains('node')) {
                        el.style.transform = `translateY(${scrollPosition * 0.05}px)`;
                    }
                });
            });
        });
    </script>
</body>
</html>